﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Xml.Linq;
using System.Data;

namespace OneWord
{
    /// <summary>
    /// Interaction logic for WordTable.xaml
    /// </summary>
    public partial class WordTable : Window
    {
        public WordTable()
        {
            InitializeComponent();

            //XElement xe = XElement.Load();
            //var result = from x in xe.Elements("text")
            //             select x;
            ////Trace.WriteLine(xDocument);
            //this.dataGrid.ItemsSource = result;
            //DataGridTextColumn dgname = new DataGridTextColumn();
            //Binding b = new Binding();


            //this.dataGrid.Columns.Add(dgname);
            ////this.dataGrid.ItemsSource = x.Elements("text");
            XmlDataProvider xml = new XmlDataProvider();
            
            //xml.Source = new Uri("../../Resouce/2000-1.xml");
            //xml.XPath = "wordbook/item";

            //XDocument xdoc = XDocument.Load("../../Resouce/2000-1.xml");
            var xdoc = XElement.Load("../../Resouce/2000-1.xml");

            this.dataGrid.DataContext = xdoc.Elements("item");
            
        }

    }
}
